const moment = require("moment");
module.exports = {
    async pintuan(product) {
        console.log("1qqqq-->", product);
        for (let x = 0; x < product.data.length; x++) {
            console.log("ccc");
            if (Number(product.data[x].type) === 2) {
                console.log("111111");
                product.data[x].pintuan_set = await doodoo
                    .model("pintuan_set")
                    .query(qb => {
                        qb.where("shop_id", "=", product.data[x].shop_id);
                        qb.where("product_id", "=", product.data[x].id);
                    })
                    .fetch();
            }
        }
        return product;
    }
};
